<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="scripts/jquery.min.js"></script>
  </head>
  <body>
      <div id="div1">
          <input type="text" value="input1"/>
      </div>
      <div id="div2">
          <input type="text" value="input2"/>
      </div>
      <input type="hidden" name="hiddenInput1" value="hiddenInput" />
      <input type="hidden" name="hiddenInput2" value="hiddenInput" />
      <script type="text/javascript">
          //getElementsByTagName可以由任意DOM元素调用，此时搜索范围限制在调用元素内
          var inputArray = document.getElementById("div1").getElementsByTagName("input");
          alert("Length: " + inputArray.length + "; Index0: " +inputArray[0].value);
          var inputArray2 = document.getElementsByTagName("input");
          alert("Length: " + inputArray2.length);
          //多个属性选择器并列书写
          alert($("input[name=hiddenInput1][type=hidden]").length);
   </script>
  </body>
</html>
